﻿<UserControl x:Class="ConfigurationSetupUtility.Screens.DatabaseSetupScreen"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" MaxWidth="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=FrameworkElement, AncestorLevel=1}, Path=ActualWidth}">
    <DockPanel>
        <Label Content="Set up a database" DockPanel.Dock="Top" Margin="5" HorizontalContentAlignment="Center" FontSize="16" FontWeight="Bold" />
        <StackPanel DockPanel.Dock="Bottom">
            <TextBlock Text="Please select the type of database you would like to have set up." TextAlignment="Center" Margin="20,0,20,5" TextWrapping="Wrap" />
            <StackPanel HorizontalAlignment="Center">
                <StackPanel Orientation="Horizontal" Margin="0,5,0,10">
                    <StackPanel HorizontalAlignment="Center" Margin="0,0,5,0">
                        <RadioButton Content="SQL Server" Height="18" IsChecked="True" GroupName="DatabaseType" Checked="SqlServerDatabaseRadioButton_Checked" />
                        <RadioButton Content="MySQL" Height="18" GroupName="DatabaseType" Checked="MySqlRadioButton_Checked" />
                    </StackPanel>
                    <StackPanel HorizontalAlignment="Center" Margin="5,0,0,0">
                        <RadioButton Content="Oracle" Height="18" GroupName="DatabaseType" Checked="OracleRadioButton_Checked" />
                        <RadioButton Content="SQLite" Height="18" GroupName="DatabaseType" Checked="SqliteRadioButton_Checked" />
                    </StackPanel>
                </StackPanel>
                <StackPanel HorizontalAlignment="Center">
                    <StackPanel>
                        <CheckBox Content="Run initial data script" Height="18" IsChecked="True" Visibility="Collapsed" IsEnabled="False" Name="m_initialDataScriptCheckBox" Checked="InitialDataScriptCheckBox_Checked" Unchecked="InitialDataScriptCheckBox_Unchecked" ToolTip="Check this box to load initial settings (e.g., default signal types, etc.) into the new database." />
                        <CheckBox Content="Run sample data script" Height="18" Margin="0,0,0,0" IsEnabled="{Binding ElementName=m_initialDataScriptCheckBox, Path=IsChecked}" Checked="SampleDataScriptCheckBox_Checked" Unchecked="SampleDataScriptCheckBox_Unchecked" Name="m_sampleDataScriptCheckBox" ToolTip="Check this box to load one sample device into the new database." Click="SampleDataScriptCheckBox_Click" />
                        <CheckBox Content="Run audit log trigger scripts" Height="18" Margin="0,0,0,0" Checked="EnableAuditLogCheckBox_Checked" Unchecked="EnableAuditLogCheckBox_Unchecked" Name="m_enableAuditLogCheckBox" Click="EnableAuditLogCheckBox_Click">
                            <CheckBox.ToolTip>
                                <TextBlock>                            
                                    Check this box to run the scripts that will enable audit logging on your database.
                                    <LineBreak/>
                                    <LineBreak/>
                                    Enabling auditing causes all configuration changes to be logged by user which may
                                    <LineBreak />                            
                                    be required for production deployments with compliance implications.
                                    <LineBreak />
                                    <LineBreak />
                                    However, this level of logging can degrade performance in the PDQTracker Manager, 
                                    <LineBreak />
                                    so this should only be enabled if needed.
                                </TextBlock>
                            </CheckBox.ToolTip>
                        </CheckBox>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
            <TextBlock DockPanel.Dock="Bottom" TextAlignment="Center" TextWrapping="Wrap" Margin="5,5,5,0" Name="m_newDatabaseWarning">
                Creating a new database for SQL Server or MySQL requires that the database system
                be installed locally. If you want to create a database on a remote system, use the
                SQL scripts located in the "Database scripts" folder where this application is
                installed and execute the desired scripts on the remote database system.
                <LineBreak /><LineBreak />
                If necessary, you can go back and select:<LineBreak />
                "<Italic>I want to use an existing configuration.</Italic>"
            </TextBlock>
        </StackPanel>
    </DockPanel>
</UserControl>
